<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>Collection, yii\mongodb\file\Collection - Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w11909" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w11909-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w11909-collapse" class="collapse navbar-collapse"><ul id="w11910" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w11911" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item" href="#navigation-11900" data-toggle="collapse" data-parent="#navigation">yii\mongodb <b class="caret"></b></a><div id="navigation-11900" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-mongodb-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-mongodb-cache.html">Cache</a>
<a class="list-group-item" href="./yii-mongodb-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-command.html">Command</a>
<a class="list-group-item" href="./yii-mongodb-connection.html">Connection</a>
<a class="list-group-item" href="./yii-mongodb-database.html">Database</a>
<a class="list-group-item" href="./yii-mongodb-exception.html">Exception</a>
<a class="list-group-item" href="./yii-mongodb-logbuilder.html">LogBuilder</a>
<a class="list-group-item" href="./yii-mongodb-migration.html">Migration</a>
<a class="list-group-item" href="./yii-mongodb-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-mongodb-session.html">Session</a></div>
<a class="list-group-item" href="#navigation-11901" data-toggle="collapse" data-parent="#navigation">yii\mongodb\console\controllers <b class="caret"></b></a><div id="navigation-11901" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-console-controllers-migratecontroller.html">MigrateController</a></div>
<a class="list-group-item" href="#navigation-11902" data-toggle="collapse" data-parent="#navigation">yii\mongodb\debug <b class="caret"></b></a><div id="navigation-11902" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-debug-explainaction.html">ExplainAction</a>
<a class="list-group-item" href="./yii-mongodb-debug-mongodbpanel.html">MongoDbPanel</a></div>
<a class="list-group-item active" href="#navigation-11903" data-toggle="collapse" data-parent="#navigation">yii\mongodb\file <b class="caret"></b></a><div id="navigation-11903" class="submenu panel-collapse collapse in"><a class="list-group-item" href="./yii-mongodb-file-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-file-activerecord.html">ActiveRecord</a>
<a class="list-group-item active" href="./yii-mongodb-file-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-file-cursor.html">Cursor</a>
<a class="list-group-item" href="./yii-mongodb-file-download.html">Download</a>
<a class="list-group-item" href="./yii-mongodb-file-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-file-streamwrapper.html">StreamWrapper</a>
<a class="list-group-item" href="./yii-mongodb-file-upload.html">Upload</a></div>
<a class="list-group-item" href="#navigation-11904" data-toggle="collapse" data-parent="#navigation">yii\mongodb\gii\model <b class="caret"></b></a><div id="navigation-11904" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-gii-model-generator.html">Generator</a></div>
<a class="list-group-item" href="#navigation-11905" data-toggle="collapse" data-parent="#navigation">yii\mongodb\i18n <b class="caret"></b></a><div id="navigation-11905" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-i18n-mongodbmessagesource.html">MongoDbMessageSource</a></div>
<a class="list-group-item" href="#navigation-11906" data-toggle="collapse" data-parent="#navigation">yii\mongodb\log <b class="caret"></b></a><div id="navigation-11906" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-log-mongodbtarget.html">MongoDbTarget</a></div>
<a class="list-group-item" href="#navigation-11907" data-toggle="collapse" data-parent="#navigation">yii\mongodb\rbac <b class="caret"></b></a><div id="navigation-11907" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-rbac-mongodbmanager.html">MongoDbManager</a>
<a class="list-group-item" href="./yii-mongodb-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-mongodb-rbac-role.html">Role</a></div>
<a class="list-group-item" href="#navigation-11908" data-toggle="collapse" data-parent="#navigation">yii\mongodb\validators <b class="caret"></b></a><div id="navigation-11908" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-validators-mongodatevalidator.html">MongoDateValidator</a>
<a class="list-group-item" href="./yii-mongodb-validators-mongoidvalidator.html">MongoIdValidator</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>Class yii\mongodb\file\Collection</h1>
<div class="top-nav">
    <a href="index.html">All Classes</a>
            | <a href="#properties">Properties</a>
                | <a href="#methods">Methods</a>
            </div>

<table class="summaryTable docClass table table-bordered">
    <colgroup>
        <col class="col-name" />
        <col class="col-value" />
    </colgroup>
            <tr><th>Inheritance</th><td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a> &raquo;
<a href="yii-mongodb-collection.html">yii\mongodb\Collection</a> &raquo;
<a href="yii-base-object.html">yii\base\Object</a></td></tr>
                <tr><th>Implements</th><td><a href="yii-base-configurable.html">yii\base\Configurable</a></td></tr>
                                    <tr><th>Available since version</th><td>2.0</td></tr>
                    <tr>
          <th>Source Code</th>
          <td><a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php">https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php</a></td>
        </tr>
    </table>

<div class="class-description">
    <p><strong>Collection represents the Mongo GridFS collection information.</strong></p>
    <p>A file collection object is usually created by calling <span class="broken-link">\yii\mongodb\file\Database::getFileCollection()</span> or <span class="broken-link">\yii\mongodb\file\Connection::getFileCollection()</span>.</p>
<p>File collection inherits all interface from regular <span class="broken-link">\yii\mongo\Collection</span>, adding methods to store files.</p>

    </div>

<a id="properties"></a>

<div class="summary doc-property">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-property" />
    <col class="col-type" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
        <tr id="$chunkCollection">
        <td><a href="yii-mongodb-file-collection.html#$chunkCollection-detail">$chunkCollection</a></td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
        <td>Mongo collection instance.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="$database">
        <td><a href="yii-mongodb-file-collection.html#$database-detail">$database</a></td>
        <td><a href="yii-mongodb-database.html">yii\mongodb\Database</a></td>
        <td>MongoDB database instance.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="$fileCollection">
        <td><a href="yii-mongodb-file-collection.html#$fileCollection-detail">$fileCollection</a></td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
        <td>Mongo collection instance.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="$fullName">
        <td><a href="yii-mongodb-collection.html#$fullName-detail">$fullName</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>Full name of this collection, including database name.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="$name">
        <td><a href="yii-mongodb-collection.html#$name-detail">$name</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>Name of this collection.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="$prefix">
        <td><a href="yii-mongodb-file-collection.html#$prefix-detail">$prefix</a></td>
        <td><a href="http://www.php.net/language.types.string">string</a></td>
        <td>Prefix of this file collection.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
    </table>
</div>

<a id="methods"></a>

<div class="summary doc-method">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summary-table table table-striped table-bordered table-hover">
<colgroup>
    <col class="col-method" />
    <col class="col-description" />
    <col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
        <tr class="inherited" id="__call()">
        <td><a href="yii-base-object.html#__call()-detail">__call()</a></td>
        <td>Calls the named method which is not a class method.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__construct()">
        <td><a href="yii-base-object.html#__construct()-detail">__construct()</a></td>
        <td>Constructor.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__get()">
        <td><a href="yii-base-object.html#__get()-detail">__get()</a></td>
        <td>Returns the value of an object property.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__isset()">
        <td><a href="yii-base-object.html#__isset()-detail">__isset()</a></td>
        <td>Checks if a property is set, i.e. defined and not null.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__set()">
        <td><a href="yii-base-object.html#__set()-detail">__set()</a></td>
        <td>Sets value of an object property.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="__unset()">
        <td><a href="yii-base-object.html#__unset()-detail">__unset()</a></td>
        <td>Sets an object property to null.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="aggregate()">
        <td><a href="yii-mongodb-collection.html#aggregate()-detail">aggregate()</a></td>
        <td>Performs aggregation using Mongo Aggregation Framework.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="batchInsert()">
        <td><a href="yii-mongodb-collection.html#batchInsert()-detail">batchInsert()</a></td>
        <td>Inserts several new rows into collection.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="canGetProperty()">
        <td><a href="yii-base-object.html#canGetProperty()-detail">canGetProperty()</a></td>
        <td>Returns a value indicating whether a property can be read.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="canSetProperty()">
        <td><a href="yii-base-object.html#canSetProperty()-detail">canSetProperty()</a></td>
        <td>Returns a value indicating whether a property can be set.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="className()">
        <td><a href="yii-base-object.html#className()-detail">className()</a></td>
        <td>Returns the fully qualified name of this class.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="count()">
        <td><a href="yii-mongodb-collection.html#count()-detail">count()</a></td>
        <td>Counts records in this collection.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="createDownload()">
        <td><a href="yii-mongodb-file-collection.html#createDownload()-detail">createDownload()</a></td>
        <td>Creates download command.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="createIndex()">
        <td><a href="yii-mongodb-collection.html#createIndex()-detail">createIndex()</a></td>
        <td>Creates an index on the collection and the specified fields.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="createIndexes()">
        <td><a href="yii-mongodb-collection.html#createIndexes()-detail">createIndexes()</a></td>
        <td>Creates several indexes at once.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="createUpload()">
        <td><a href="yii-mongodb-file-collection.html#createUpload()-detail">createUpload()</a></td>
        <td>Creates upload command.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="delete()">
        <td><a href="yii-mongodb-file-collection.html#delete()-detail">delete()</a></td>
        <td>Deletes the file with given _id.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="distinct()">
        <td><a href="yii-mongodb-collection.html#distinct()-detail">distinct()</a></td>
        <td>Returns a list of distinct values for the given column across a collection.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="drop()">
        <td><a href="yii-mongodb-file-collection.html#drop()-detail">drop()</a></td>
        <td>Drops this collection.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="dropAllIndexes()">
        <td><a href="yii-mongodb-collection.html#dropAllIndexes()-detail">dropAllIndexes()</a></td>
        <td>Drops all indexes for this collection.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="dropIndex()">
        <td><a href="yii-mongodb-collection.html#dropIndex()-detail">dropIndex()</a></td>
        <td>Drop indexes for specified column(s).</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="dropIndexes()">
        <td><a href="yii-mongodb-collection.html#dropIndexes()-detail">dropIndexes()</a></td>
        <td>Drops collection indexes by name.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="ensureIndexes()">
        <td><a href="yii-mongodb-file-collection.html#ensureIndexes()-detail">ensureIndexes()</a></td>
        <td>Makes sure that indexes, which are crucial for the file processing,
exist at this collection and <a href="yii-mongodb-file-collection.html#$chunkCollection-detail">$chunkCollection</a>.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="find()">
        <td><a href="yii-mongodb-file-collection.html#find()-detail">find()</a></td>
        <td>Returns a cursor for the search results.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="findAndModify()">
        <td><a href="yii-mongodb-collection.html#findAndModify()-detail">findAndModify()</a></td>
        <td>Updates a document and returns it.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="findOne()">
        <td><a href="yii-mongodb-collection.html#findOne()-detail">findOne()</a></td>
        <td>Returns a single document.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="get()">
        <td><a href="yii-mongodb-file-collection.html#get()-detail">get()</a></td>
        <td>Retrieves the file with given _id.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="getChunkCollection()">
        <td><a href="yii-mongodb-file-collection.html#getChunkCollection()-detail">getChunkCollection()</a></td>
        <td>Returns the MongoDB collection for the file chunks.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="getFileCollection()">
        <td><a href="yii-mongodb-file-collection.html#getFileCollection()-detail">getFileCollection()</a></td>
        <td>Returns the MongoDB collection for the files.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="getFullName()">
        <td><a href="yii-mongodb-collection.html#getFullName()-detail">getFullName()</a></td>
        <td></td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="getPrefix()">
        <td><a href="yii-mongodb-file-collection.html#getPrefix()-detail">getPrefix()</a></td>
        <td></td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="group()">
        <td><a href="yii-mongodb-collection.html#group()-detail">group()</a></td>
        <td>Performs aggregation using Mongo "group" command.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="hasMethod()">
        <td><a href="yii-base-object.html#hasMethod()-detail">hasMethod()</a></td>
        <td>Returns a value indicating whether a method is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="hasProperty()">
        <td><a href="yii-base-object.html#hasProperty()-detail">hasProperty()</a></td>
        <td>Returns a value indicating whether a property is defined.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="init()">
        <td><a href="yii-base-object.html#init()-detail">init()</a></td>
        <td>Initializes the object.</td>
        <td><a href="yii-base-object.html">yii\base\Object</a></td>
    </tr>
            <tr class="inherited" id="insert()">
        <td><a href="yii-mongodb-collection.html#insert()-detail">insert()</a></td>
        <td>Inserts new data into collection.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="insertFile()">
        <td><a href="yii-mongodb-file-collection.html#insertFile()-detail">insertFile()</a></td>
        <td>Creates new file in GridFS collection from given local filesystem file.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="insertFileContent()">
        <td><a href="yii-mongodb-file-collection.html#insertFileContent()-detail">insertFileContent()</a></td>
        <td>Creates new file in GridFS collection with specified content.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr id="insertUploads()">
        <td><a href="yii-mongodb-file-collection.html#insertUploads()-detail">insertUploads()</a></td>
        <td>Creates new file in GridFS collection from uploaded file.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="listIndexes()">
        <td><a href="yii-mongodb-collection.html#listIndexes()-detail">listIndexes()</a></td>
        <td>Returns the list of defined indexes.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr class="inherited" id="mapReduce()">
        <td><a href="yii-mongodb-collection.html#mapReduce()-detail">mapReduce()</a></td>
        <td>Performs aggregation using MongoDB "map-reduce" mechanism.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="remove()">
        <td><a href="yii-mongodb-file-collection.html#remove()-detail">remove()</a></td>
        <td>Removes data from the collection.</td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="save()">
        <td><a href="yii-mongodb-collection.html#save()-detail">save()</a></td>
        <td>Update the existing database data, otherwise insert this data</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
            <tr id="setPrefix()">
        <td><a href="yii-mongodb-file-collection.html#setPrefix()-detail">setPrefix()</a></td>
        <td></td>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
    </tr>
            <tr class="inherited" id="update()">
        <td><a href="yii-mongodb-collection.html#update()-detail">update()</a></td>
        <td>Updates the rows, which matches given criteria by given data.</td>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
    </tr>
    </table>
</div>

<a id="events"></a>

<a id="constants"></a>

<h2>Property Details</h2>

<div class="property-doc">

    <div class="detail-header h3" id="$chunkCollection-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#$chunkCollection-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $chunkCollection        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>Mongo collection instance.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></span> <strong><a href="yii-mongodb-file-collection.html#getChunkCollection()-detail">getChunkCollection</a></strong> ( <span style="color: #0000BB">$refresh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</div>


    <div class="detail-header h3" id="$database-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#$database-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L34" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L34" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $database        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>MongoDB database instance.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-database.html">yii\mongodb\Database</a></span> <a href="yii-mongodb-file-collection.html#$database-detail">$database</a> <span style="color: #0000BB"></span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span></div>


    <div class="detail-header h3" id="$fileCollection-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#$fileCollection-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $fileCollection        <span class="detail-header-tag small">
            public                         <em>read-only</em>                         property
                    </span>
    </div>

    <div class="doc-description">
        <p>Mongo collection instance.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></span> <strong><a href="yii-mongodb-file-collection.html#getFileCollection()-detail">getFileCollection</a></strong> ( <span style="color: #0000BB">$refresh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</div>


    <div class="detail-header h3" id="$prefix-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#$prefix-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        $prefix        <span class="detail-header-tag small">
            public                                                property
                    </span>
    </div>

    <div class="doc-description">
        <p>Prefix of this file collection.</p>

            </div>

    <div class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-mongodb-file-collection.html#getPrefix()-detail">getPrefix</a></strong> ( )<br /><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-file-collection.html#setPrefix()-detail">setPrefix</a></strong> ( <span style="color: #0000BB">$prefix</span> )</div>

</div>
<h2>Method Details</h2>

<div class="method-doc">

    <div class="detail-header h3" id="createDownload()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#createDownload()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L90" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L90" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        createDownload()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.1)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates download command.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-file-download.html">yii\mongodb\file\Download</a></span> <strong><a href="yii-mongodb-file-collection.html#createDownload()-detail">createDownload</a></strong> ( <span style="color: #0000BB">$document</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$document</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a>|\MongoDB\BSON\ObjectID</td>
                  <td class="param-desc-col"><p>File document ot be downloaded.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-file-download.html">yii\mongodb\file\Download</a></td>
                  <td class="param-desc-col"><p>File download instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="createUpload()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#createUpload()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L77" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L77" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        createUpload()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.1)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates upload command.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-file-upload.html">yii\mongodb\file\Upload</a></span> <strong><a href="yii-mongodb-file-collection.html#createUpload()-detail">createUpload</a></strong> ( <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Upload options.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-file-upload.html">yii\mongodb\file\Upload</a></td>
                  <td class="param-desc-col"><p>File upload instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="delete()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#delete()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L275" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L275" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        delete()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Deletes the file with given _id.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-file-collection.html#delete()-detail">delete</a></strong> ( <span style="color: #0000BB">$id</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$id</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>_id of the file to find.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the operation was successful.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="drop()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#drop()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L139" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L139" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        drop()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Drops this collection.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-file-collection.html#drop()-detail">drop</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether the operation successful.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="ensureIndexes()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#ensureIndexes()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L288" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L288" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        ensureIndexes()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Makes sure that indexes, which are crucial for the file processing,
exist at this collection and <a href="yii-mongodb-file-collection.html#$chunkCollection-detail">$chunkCollection</a>.</strong></p>

        <p>The check result is cached per collection instance.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-file-collection.html">$this</a></span> <strong><a href="yii-mongodb-file-collection.html#ensureIndexes()-detail">ensureIndexes</a></strong> ( <span style="color: #0000BB">$force&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$force</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to ignore internal collection instance cache.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-file-collection.html">$this</a></td>
                  <td class="param-desc-col"><p>Self reference.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="find()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#find()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L148" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L148" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        find()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns a cursor for the search results.</strong></p>

        <p>In order to perform "find" queries use <a href="yii-mongodb-file-query.html">yii\mongodb\file\Query</a> class.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-file-cursor.html">yii\mongodb\file\Cursor</a></span> <strong><a href="yii-mongodb-file-collection.html#find()-detail">find</a></strong> ( <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$fields&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Query condition</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$fields</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Fields to be selected</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Query options (available since 2.1).</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-file-cursor.html">yii\mongodb\file\Cursor</a></td>
                  <td class="param-desc-col"><p>Cursor for the search results</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="get()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#get()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L260" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L260" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        get()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Retrieves the file with given _id.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">\MongoGridFSFile|<a href="http://www.php.net/language.types.null">null</a></span> <strong><a href="yii-mongodb-file-collection.html#get()-detail">get</a></strong> ( <span style="color: #0000BB">$id</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$id</span></td>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>_id of the file to find.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">\MongoGridFSFile|<a href="http://www.php.net/language.types.null">null</a></td>
                  <td class="param-desc-col"><p>Found file, or null if file does not exist</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="getChunkCollection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#getChunkCollection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L104" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L104" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getChunkCollection()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the MongoDB collection for the file chunks.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></span> <strong><a href="yii-mongodb-file-collection.html#getChunkCollection()-detail">getChunkCollection</a></strong> ( <span style="color: #0000BB">$refresh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$refresh</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to reload the collection instance even if it is found in the cache.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
                  <td class="param-desc-col"><p>Mongo collection instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getFileCollection()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#getFileCollection()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L123" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L123" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getFileCollection()
        <span class="detail-header-tag small">
            public                                    method
                            (available since version 2.1)
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Returns the MongoDB collection for the files.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></span> <strong><a href="yii-mongodb-file-collection.html#getFileCollection()-detail">getFileCollection</a></strong> ( <span style="color: #0000BB">$refresh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">false</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$refresh</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Whether to reload the collection instance even if it is found in the cache.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
                  <td class="param-desc-col"><p>Mongo collection instance.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="getPrefix()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#getPrefix()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L57" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L57" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        getPrefix()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.string">string</a></span> <strong><a href="yii-mongodb-file-collection.html#getPrefix()-detail">getPrefix</a></strong> ( )</td></tr>
                                                <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Prefix of this file collection.</p>
</td>
                </tr>
                                    </table>

<!--	-->

    <div class="detail-header h3" id="insertFile()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#insertFile()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L206" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L206" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        insertFile()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates new file in GridFS collection from given local filesystem file.</strong></p>

        <p>Additional attributes can be added file document using $metadata.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-mongodb-file-collection.html#insertFile()-detail">insertFile</a></strong> ( <span style="color: #0000BB">$filename</span>, <span style="color: #0000BB">$metadata&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$filename</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Name of the file to store.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$metadata</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Other metadata fields to include in the file document.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The "_id" of the saved file document. This will be a generated <span class="broken-link">\MongoId</span>
unless an "_id" was explicitly specified in the metadata.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="insertFileContent()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#insertFileContent()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L223" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L223" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        insertFileContent()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates new file in GridFS collection with specified content.</strong></p>

        <p>Additional attributes can be added file document using $metadata.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-mongodb-file-collection.html#insertFileContent()-detail">insertFileContent</a></strong> ( <span style="color: #0000BB">$bytes</span>, <span style="color: #0000BB">$metadata&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$bytes</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>String of bytes to store.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$metadata</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Other metadata fields to include in the file document.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The "_id" of the saved file document. This will be a generated <span class="broken-link">\MongoId</span>
unless an "_id" was explicitly specified in the metadata.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="insertUploads()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#insertUploads()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L241" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L241" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        insertUploads()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Creates new file in GridFS collection from uploaded file.</strong></p>

        <p>Additional attributes can be added file document using $metadata.</p>

            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">mixed</span> <strong><a href="yii-mongodb-file-collection.html#insertUploads()-detail">insertUploads</a></strong> ( <span style="color: #0000BB">$name</span>, <span style="color: #0000BB">$metadata&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$name</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Name of the uploaded file to store. This should correspond to
the file field's name attribute in the HTML form.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$metadata</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Other metadata fields to include in the file document.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col">mixed</td>
                  <td class="param-desc-col"><p>The "_id" of the saved file document. This will be a generated <span class="broken-link">\MongoId</span>
unless an "_id" was explicitly specified in the metadata.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="remove()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#remove()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L156" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L156" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        remove()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong>Removes data from the collection.</strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></span> <strong><a href="yii-mongodb-file-collection.html#remove()-detail">remove</a></strong> ( <span style="color: #0000BB">$condition&nbsp;</span><span style="color: #007700">=&nbsp;[]</span>, <span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;[]</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$condition</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>Description of records to remove.</p>
</td>
                </tr>
                            <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$options</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.array">array</a></td>
                  <td class="param-desc-col"><p>List of options in format: optionName =&gt; optionValue.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">return</th>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.integer">integer</a>|<a href="http://www.php.net/language.types.boolean">boolean</a></td>
                  <td class="param-desc-col"><p>Number of updated documents or whether operation was successful.</p>
</td>
                </tr>
                                        <tr>
                  <th class="param-name-col">throws</th>
                  <td class="param-type-col"><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
                  <td class="param-desc-col"><p>on failure.</p>
</td>
                </tr>
                        </table>

<!--	-->

    <div class="detail-header h3" id="setPrefix()-detail">
        <a href="#" class="tool-link" title="go to top"><span class="glyphicon glyphicon-arrow-up"></span></a>
        <a class="tool-link hash" href="yii-mongodb-file-collection.html#setPrefix()-detail" title="direct link to this method"><span class="glyphicon icon-hash"></span></a>
                    <a href="https://github.com/yiisoft/yii2-mongodb/edit/master/file/Collection.php#L65" class="tool-link" title="edit on github"><span class="glyphicon glyphicon-pencil"></span></a>
            <a href="https://github.com/yiisoft/yii2-mongodb/blob/master/file/Collection.php#L65" class="tool-link" title="view source on github"><span class="glyphicon glyphicon-eye-open"></span></a>
        
        setPrefix()
        <span class="detail-header-tag small">
            public                                    method
                    </span>
    </div>

    <div class="doc-description">
        <p><strong></strong></p>

        
            </div>

    <table class="detail-table table table-striped table-bordered table-hover">
        <tr><td colspan="3" class="signature"><span class="signature-defs">public</span> <span class="signature-type">void</span> <strong><a href="yii-mongodb-file-collection.html#setPrefix()-detail">setPrefix</a></strong> ( <span style="color: #0000BB">$prefix</span> )</td></tr>
                                    <tr>
                  <td class="param-name-col"><span style="color: #0000BB">$prefix</span></td>
                  <td class="param-type-col"><a href="http://www.php.net/language.types.string">string</a></td>
                  <td class="param-desc-col"><p>Prefix of this file collection.</p>
</td>
                </tr>
                                                </table>

<!--	-->
</div>
        </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:15:57 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
